//
//  ViewController.m
//  UITextLable
//
//  Created by 杨晨 on 16/3/10.
//  Copyright © 2016年 杨晨. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
   
    UITextField*textField=[[UITextField alloc] initWithFrame:CGRectMake(50, 200, 200, 20)];
    
    textField.backgroundColor = [UIColor greenColor];
    
    [self.view addSubview:textField];
    
    UIImageView *rightView = [[UIImageView alloc]init];
    rightView.image = [UIImage imageNamed:@"面部_selected"];
    rightView.frame = CGRectMake(0, 0,15,15);
  
    textField.leftView = rightView;
    textField.leftViewMode = UITextFieldViewModeAlways;
    

    textField.attributedText =[[NSAttributedString alloc] initWithString:@"意思覅是"];
    
    textField.text = @"你好";
    
    textField.font = [UIFont systemFontOfSize:10];
    
    textField.textColor = [UIColor grayColor];
    
    textField.textAlignment = 2;
    
    textField.borderStyle = 1;
    
    textField.background = [UIImage imageNamed:@"面部_selected"];
   
    
    [self textFieldShouldEndEditing:nil];
    
    textField.placeholder=@"fsdfsdfsd";
}

- (BOOL)textFieldShouldEndEditing:(UITextField *)textField{
    
    NSLog(@"=========");
    return YES;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
